#ifndef _MM_H
#define _MM_H

#include "print.h"

#define PG_UNUSED	0
#define PG_NORMAL	1
#define PG_TASK		2
#define PG_REVERSED	(-1)

#define PAGE_DIR 		((0x100000 + (4 * 1024) - 1) & 0xFFFFF000)
#define PAGE_SIZE		(4 * 1024)
#define PAGE_TABLE	(PAGE_DIR + PAGE_SIZE)
#define MEMORY_RANGE	(4 * 1024)

void mm_install(void);
unsigned int alloc_page(int type);
void *page2mem(unsigned int nr);
void do_page_fault(int kl,
				   unsigned int ret_ip, unsigned int ss, unsigned int gs,
				   unsigned int fs, unsigned int es, unsigned int ds, 
				   unsigned int edi, unsigned int esi, unsigned int ebp,
				   unsigned int esp, unsigned int ebx, unsigned int edx, 
				   unsigned int ecx, unsigned int eax, unsigned int isr_nr, 
				   unsigned int err, unsigned int eip, unsigned int cs, 
				   unsigned int eflags,unsigned int old_esp, 
				   unsigned int old_ss);

#endif
